using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
using UnityGameFramework.Runtime;

namespace VRLauncher
{
    public class HouseFrom : UGuiForm
    {
        public Button RetrunButten;
        private ProcedureHouse m_ProcedureHouse = null;
        protected override void OnInit(object userData)
        {
            base.OnInit(userData);
            RetrunButten.onClick.AddListener(OnReturnCentre);
        }

        public void OnReturnCentre()
        {
            m_ProcedureHouse.ReturnMian();
        }

        protected override void OnOpen(object userData)
        {
            base.OnOpen(userData);
            m_ProcedureHouse = (ProcedureHouse)userData;
            if (m_ProcedureHouse == null)
            {
                Log.Warning("ProcedureHouse is invalid when open HouseForm.");
                return;
            }
        }

        protected override void OnClose(bool isShutdown, object userData)
        {
            base.OnClose(isShutdown, userData);
            m_ProcedureHouse= null; 
        }
    }
}
